<template>
	<view>
		<view class="search-cont">
			<view class="search">
				<input 
				type="text" 
				placeholder-class="inputclass" 
				confirm-type="search"
				focus="true"
				placeholder="请输入关键字"
				v-model="searchData"
				@confirm="onKeyInput">
			</view>
			<view class="search-code" @click="seArch()"></view>
		</view>
		<!-- 搜索历史开始 -->
		<view class="search-history" v-if="ifhistrory">
			<view class="search-title">
				<view>搜索历史</view>
				<view @click="removeStorage">
					<text class="icon-laji_huabanfuben"></text>
				</view>
			</view>
		</view>
		<!-- 搜索历史结束 -->
		<view class="menu-block">
			<block v-for="(item, index) in setData" :key="index">
				<view :class="{activetext: index == num }" @click="menubtn(item)">
					{{item}}
				</view>
			</block>
		</view>
		<!-- 内容展示开始 -->
		<view class="content-left" v-if="shopcont">
			<block v-for="(item, index) in takeshop" :index="index">
				<view class="content-view" @click="takEout(item.openid)">
					
				</view>
			</block>
		</view>
		<!-- 内容展示结束 -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				searchData: '',
				ifhistrory: false, //历史搜索控制显示与隐藏
				setData: [],
				takeshop: []
			}
		},
		methods: {
			onKeyInput(){
				
			},
			removeStorage (){ //清空历史
				
			},
			menubtn(item) {
				
			},
		}
	}
</script>

<style scoped>
@import '../../common/css/common.css';
.content-left{
	margin: 0 20upx;
}
.search-cont{
	display: flex;
	justify-content: space-between;
	height: 70upx;
	align-items: center;
	padding: 30upx 0;
}
.search{
	height: 70upx;
	line-height: 70upx;
	width: 100%;
	display: flex;
	flex-direction: row;
	background: #f8f8f8;
	border-radius: 20upx;
	margin-left: 20upx;
}
.search input{
	height: 70upx;
	line-height: 70upx;
	width: 100%;
	font-size: 30upx;
}
.inputclass{}
.search-code{
	width: 150upx;
	height: 50upx;
	text-align: center;
	font-size: 30upx;
}
/* 搜索历史css开始 */
.search-history{
	margin: 20upx;
}
.search-title{
	font-size: 30upx;
	font-weight: bold;
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 60upx;
	line-height: 60upx;
}
.search-title image{
	width: 36upx;
	height: 36upx;
	display: block;
}
.menu-block{
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	flex-wrap: wrap;
}
.menu-block view{
	background: #f7f8fa;
	border-radius: 6upx;
	font-size: 27upx;
	color: #292c33;
	text-align: center;
	padding: 10upx;
	margin: 20upx 20upx 0 0;
}
/* 搜索历史css结束 */
</style>
